﻿// ------------------------------------------------------------------------------------------------
// summary: This file contains individual parsers as plugins for handling system level 
//			features like control-flow e..g if, while, for, try, break, continue, return etc.
// version: 0.9.8.10
// author:  kishore reddy
// date:	Thursday, December 20, 2012
// ------------------------------------------------------------------------------------------------
var Exprs = {
	
	// AST class for ArrayExpr
	Array : function(token)
	{
		var exp = new ArrayExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for AssignExpr
	Assign : function(token)
	{
		var exp = new AssignExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for AssignMultiExpr
	AssignMulti : function(token)
	{
		var exp = new AssignMultiExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for BinaryExpr
	Binary : function(token)
	{
		var exp = new BinaryExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for CompareExpr
	Compare : function(token)
	{
		var exp = new CompareExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ConditionExpr
	Condition : function(token)
	{
		var exp = new ConditionExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ConstantExpr
	Constant : function(token)
	{
		var exp = new ConstantExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for FunctionCallExpr
	FunctionCall : function(token)
	{
		var exp = new FunctionCallExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for FunctionExpr
	Function : function(token)
	{
		var exp = new FunctionExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for IndexExpr
	Index : function(token)
	{
		var exp = new IndexExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for InterpolatedExpr
	Interpolated : function(token)
	{
		var exp = new InterpolatedExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for MapExpr
	Map : function(token)
	{
		var exp = new MapExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for MemberAccessExpr
	MemberAccess : function(token)
	{
		var exp = new MemberAccessExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for NamedParameterExpr
	NamedParameter : function(token)
	{
		var exp = new NamedParameterExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for NewExpr
	New : function(token)
	{
		var exp = new NewExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ParameterExpr
	Parameter : function(token)
	{
		var exp = new ParameterExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for UnaryExpr
	Unary : function(token)
	{
		var exp = new UnaryExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for BreakExpr
	Break : function(token)
	{
		var exp = new BreakExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ContinueExpr
	Continue : function(token)
	{
		var exp = new ContinueExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ForEachExpr
	ForEach : function(token)
	{
		var exp = new ForEachExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ForExpr
	For : function(token)
	{
		var exp = new ForExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for FunctionDeclareExpr
	FunctionDeclare : function(token)
	{
		var exp = new FunctionDeclareExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for IfExpr
	If : function(token)
	{
		var exp = new IfExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for LambdaExpr
	Lambda : function(token)
	{
		var exp = new LambdaExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ReturnExpr
	Return : function(token)
	{
		var exp = new ReturnExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for ThrowExpr
	Throw : function(token)
	{
		var exp = new ThrowExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for TryCatchExpr
	TryCatch : function(token)
	{
		var exp = new TryCatchExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for WhileExpr
	While : function(token)
	{
		var exp = new WhileExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	
	// AST class for VariableExpr
	Variable : function(token)
	{
		var exp = new VariableExpr();
		this.SetupContext(exp, token);
		return exp;
	},

	SetupContext: function(expr, token)
	{
	}
};